package com.op.lib;

import javax.microedition.khronos.egl.EGLConfig;
import javax.microedition.khronos.opengles.GL10;

import android.app.Activity;
import android.opengl.GLSurfaceView;
import android.util.DisplayMetrics;

public class JSRender implements GLSurfaceView.Renderer {

    public JSRender(Activity context) {
        DisplayMetrics _displayMetrics = new DisplayMetrics();
        _displayMetrics.setToDefaults();
        context.getWindowManager().getDefaultDisplay().getMetrics(_displayMetrics);
        //System.out.println(_displayMetrics.widthPixels + "," + _displayMetrics.heightPixels);
        initScreenSize(_displayMetrics.widthPixels, _displayMetrics.heightPixels);
    }

    public native void initScreenSize(int width, int height);

    @Override
    public native void onDrawFrame(GL10 arg0);

    @Override
    public native void onSurfaceChanged(GL10 arg0, int w, int h);

    @Override
    public native void onSurfaceCreated(GL10 arg0, EGLConfig config);
}
